# Maintainer: David Runge <dvzrv@archlinux.org>

_name=fomp
pkgname=fomp.lv2
pkgver=1.2.4
pkgrel=2
pkgdesc="An LV2 port of the MCP, VCO, FIL, and WAH plugins by Fons Adriaensen."
arch=(loong64 x86_64)
url="https://gitlab.com/drobilla/fomp"
license=(GPL2)
groups=(lv2-plugins pro-audio)
depends=(gcc-libs glibc lv2-host)
makedepends=(lv2 meson)
checkdepends=(lv2lint)
options=(debug)
source=(https://download.drobilla.net/$_name-$pkgver.tar.xz{,.sig})
sha512sums=('8869a7214358f7a02b63cb106e6b30cec1a167f9fd1cbb1f018947a525e1b3491622fe60291876a9c1e3ae8a572e5d636bb66822e3cdbf28bfe894069a3bffd2'
            'SKIP')
b2sums=('6319777d42aff6a77d0776e4a8f1f30be37d1da4b3c0555462ea00f9af37a217d5f5b037c402eff9d327f759e70639e6c733e372a1c3ab20114d97e56773a786'
        'SKIP')
validpgpkeys=(907D226E7E13FA337F014A083672782A9BF368F3)  # David Robillard <d@drobilla.net>

build() {
  arch-meson $_name-$pkgver build -D tests=disabled
  meson compile -C build
}

check() {
  local plugin_name
  local plugin_names=(autowah cs_chorus1 cs_chorus2 mvchpf1 mvclpf1 mvclpf2 mvclpf3 mvclpf4 parametric1 pulse_vco rec_vco saw_vco triple_chorus)

  for plugin_name in "${plugin_names[@]}"; do
    lv2lint -Mpack -I "build/$pkgname/" "http://drobilla.net/plugins/fomp/$plugin_name"
  done
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -vDm 644 $_name-$pkgver/{AUTHORS,NEWS,README.md} -t "$pkgdir/usr/share/doc/$pkgname/"
}
